package com.itheima.service.impl;

import com.itheima.dao.UserDao;
import com.itheima.service.UserService;

import java.util.*;

/**
 * @author by itheima
 * @Date 2022/4/21
 * @Description
 */
public class UserServiceImpl5 implements UserService {

    private String name;
    private int age;
    private UserDao dao;
    private Date date;
    //添加集合属性
    private String[] hobbies;
    private List<String> sports;
    private Set<String> address;
    private Map<String,String> maps;
    private Properties propertiesData;



    /**
     * 先运行构造器方法，然后再运行init方法和销毁方法
     * 1
     */
    public UserServiceImpl5() {
        System.out.println("UserServiceImpl2 create .....");
    }

    @Override
    public void save() {
        System.out.println("UserService save run ....");
    }

    /**
     * 定义初始化方法
     * 方法名称随便定义
     * 2
     */
    public void initMethod(){
        //加载外部xml properties文件
        //发送邮件
        System.out.println("initMethod run.....");
    }

    /**
     * 定义销毁方法
     * 方法名称随便定义
     * 3
     */
    public void destroyMethod(){
        System.out.println("destroyMethod run.....");
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setDao(UserDao dao) {
        this.dao = dao;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public void setHobbies(String[] hobbies) {
        this.hobbies = hobbies;
    }

    public void setSports(List<String> sports) {
        this.sports = sports;
    }

    public void setAddress(Set<String> address) {
        this.address = address;
    }

    public void setMaps(Map<String, String> maps) {
        this.maps = maps;
    }

    public void setPropertiesData(Properties propertiesData) {
        this.propertiesData = propertiesData;
    }
}
